<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0" />
    <title>美策平台</title>
    <link rel="icon" type="image/png" href="/img/icon.png">
    <link rel="stylesheet" type="text/css" href="../../datepicker/jquery-ui.min.css">
    <link rel="stylesheet" type="text/css" href="../../css/app.css">
    <link rel="stylesheet" type="text/css" href="../../css/my.css">
    <script type="text/javascript" src="../../js/jquery.min.js"></script>
    <script type="text/javascript" src="/h5/js/all.js"></script>
    <style>
        #success {
            margin:20% auto;
            text-align:center;
            line-height:60px;
        }
        #success button {
            padding:10px 20px;
            color:#fefefe;
            font-size:20px;
            border:0;
            border-radius:2px;
            background-image:-webkit-linear-gradient(left , #589cff, #3360fa);
            background-image:-o-linear-gradient(left , #589cff, #3360fa);
            background-image:linear-gradient(left , #589cff, #3360fa);
            cursor:pointer;
        }
    </style>
</head>
<body>
<!--
    制作者：九哥
    页面：我的账户-充值成功
    时间：2019-07-28
-->





<!----------我的账户---------->
<div id="accountPage">
    <div id="accountTitle">
        <b>我的账户-<span class="oper"></span>成功</b>
        <img src="../../images/return.png" id="accountRtn">
    </div>
    <div id="success">
        <h4>恭喜你，支付宝<span class="oper"></span>成功！</h4>
        <a href="/h5/my/account.html">
            <button id="btn" style="display:none;">返回账户主页</button>
        </a>
    </div>
</div>
<div  id="zfb"></div>
<!----------我的账户---------->





<!----------错误提示---------->
<div id="errMsg"></div>
<!----------错误提示---------->
</body>
<script type="text/javascript" src="../../js/app.js"></script>
<script type="text/javascript" src="../../js/cache.js"></script>
<script type="text/javascript" src="../../js/mysetPageChange.js"></script>
<script type="text/javascript" src="../../js/myset2.js"></script>
</html>

<script>
    (function(){
        var oper = getUrlParam('oper');
        if (oper=='income') {
            $('.oper').html('充值');
        } else if (oper=='out') {
            $('.oper').html('提现');
        } else {
            $('.oper').html('未知');
        }
        //返回按钮延时出现
        setTimeout(function(){
            $('#btn').show();
        },1000 * 2);
        //更新状态
        setSuccess();
    })();
    /**
     * 充值/提现成功
     * */
    function setSuccess(){
        var oper = getUrlParam('oper');
        var serial = getUrlParam('serial');
        var money = getUrlParam('money');
        var userInfo = cacheGet('userInfo'); //获取用户信息
        if (userInfo==null || userInfo.token=='undefined') {
            window.location.href = '/h5/login/login.html';
        }
        if (!serial) {
            getAppErrMsg('编号错误！','',0);
        }
        //判断，没有本地缓存，则显示加载中
        var formData = {
            app_access:app_access,
            token:userInfo.token,
            type:userInfo.type,
            cate:userInfo.cate,
            oper:oper,
            serial:serial,
            money:money
        };
        $.ajax({
            type: 'post',
            url: getDomain() + 'account/success',
            data: formData,
            success: function(res){
//                console.log(res); return;
                if (res.code!=0) {
                    console.log(res); return;
                }
                getAppErrMsg('更新成功！','',0);
            },
            error: function(){
                console.log('操作失败！'); return;
            }
        });
    }
</script>